﻿<UserControl x:Class="Sobiens.WPF.Controls.UserControls.LanguagesDropDown" Name="ucLanguageCombo"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Convert="clr-namespace:Sobiens.WPF.Controls.Classes" 
             mc:Ignorable="d" 
            Height="40" Width="200">
    <UserControl.Resources>
        <Convert:Converter x:Key="Converters"></Convert:Converter>
    </UserControl.Resources>
    <Grid>
        <ComboBox Name="LanguageCombo" 
    ItemsSource="{Binding ElementName=ucLanguageCombo, Path=Languages}" 
	SelectedValuePath="code"  SelectedValue="{Binding ElementName=ucLanguageCombo, 
	Path=SelectedLanguage}" >
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Width="20" Height="20" Margin="5" 
			Source="{Binding code, 
			Converter={StaticResource Converters}}"/>
                        <TextBlock Margin="5" Text="{Binding value}"/>
                    </StackPanel>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
    </Grid>
</UserControl>
